import com.sven.javaspi.Driver;
import org.junit.Test;

import java.util.ServiceLoader;

public class SpiMian {

    //java spi扩展点实现
    @Test
    public void test1() {
        ServiceLoader<Driver> serviceLoader = ServiceLoader.load(Driver.class);
        serviceLoader.forEach(driver -> System.out.println(driver.connect()));
    }

}
